<?php include "app/views/includes/header.phtml"; ?>

<div id="wrapper" class="details">

<?php if(isset($biere)) : ?>
    <aside class="colonne-left">
      <div class="img-wrapper">
        <img src="<?php echo $biere->get('image'); ?>" alt="<?php echo $biere->get('nom'); ?>" class="img-responsive"/>
      </div>
      
      <hr />
      <table>
        <tr>
          <td>Alcool : </td>
          <td><?php echo $biere->get('alcool'); ?></td>
        </tr>
        <tr>
          <td>Type : </td>
          <td><a href="?action=recherche&amp;type=<?php echo $biere->get('type')->get('no'); ?>" title="Afficher les bières de type <?php echo $biere->get('type')->get('type'); ?>"><?php echo $biere->get('type')->get('type'); ?></a></td>
        </tr>
        <tr>
          <td>Pays : </td>
          <td><a href="?action=recherche&amp;pays=<?php echo $biere->get('pays')->get('no'); ?>" title="Afficher les bieres du pays <?php echo $biere->get('pays')->get('title'); ?>"><?php echo $biere->get('pays')->get('title'); ?></a></td>
        </tr>
        <tr>
          <td>Fermentation : </td>
          <td>
            <a href="?action=recherche&amp;degre=<?php echo $biere->get('fermentation')->get('no'); ?>" class="tooltip tooltip-right" title="Afficher les bières de fermentation <?php echo $biere->get('fermentation')->get('degre'); ?>"><?php echo $biere->get('fermentation')->get('degre'); ?>
            </a>
          </td>
        </tr>
        <tr>
          <td>Brasserie : </td>
          <td><?php echo $biere->get('brasserie'); ?></td>
        </tr>

      </table>

    </aside>

    <section class="colonne-centre">
      <header id="header-details">
        
        <div class="text-center star-rate-content nice-box">
          <?php $note = $biere->getNotation(1); ?>
          <ul class="star-rate">
            <li <?php echo ($note >= 1.0) ? "class='active'" : ""; ?> >
              <a href="/?controller=note&amp;action=ajouterNote&amp;idBiere=<?php echo $biere->get('no'); ?>&amp;note=1" title="Note 1"></a>
            </li>
            <li <?php echo ($note >= 2.0) ? "class='active'" : ""; ?> >
              <a href="/?controller=note&amp;action=ajouterNote&amp;idBiere=<?php echo $biere->get('no'); ?>&amp;note=2" title="Note 2"></a>
            </li>
            <li <?php echo ($note >= 3.0) ? "class='active'" : ""; ?> ><a href="/?controller=note&amp;action=ajouterNote&amp;idBiere=<?php echo $biere->get('no'); ?>&amp;note=3" title="Note 3"></a>
            </li>
            <li <?php echo ($note >= 4.0) ? "class='active'" : ""; ?> >
              <a href="/?controller=note&amp;action=ajouterNote&amp;idBiere=<?php echo $biere->get('no'); ?>&amp;note=4" title="Note 4"></a>
            </li>
            <li <?php echo ($note == 5.0) ? "class='active'" : ""; ?>>
              <a href="/?controller=note&amp;action=ajouterNote&amp;idBiere=<?php echo $biere->get('no'); ?>&amp;note=5" title="Note 5"></a>
            </li>
          </ul>
          <p class="text-center"><?php echo $note . "/5 avec " .$biere->getNombreDeNotes(); echo $biere->getNombreDeNotes() == 1 ? " vote" : " votes"; ?></p>
        </div>
      </header>

      <h1 class="text-shadow"><?php echo $biere->get('nom'); ?></h1>

    	<p class="description"><?php echo $biere->get('descriptif'); ?></p>

      <section>
        <?php include "app/views/beers/ecrireCommentaire.phtml"; ?>
        <?php include "app/views/beers/commentaire.phtml"; ?>

      </section>

    </section>

<?php else: ?>
      <h3 class="text-center">Bière introuvable</h3>
<?php endif;?>

    <aside class="colonne-droite">
<?php include "app/views/includes/aside.phtml"; ?>
    </aside>

</div>

<?php include "app/views/includes/footer.phtml"; ?>
